home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C++
/
Frameworks
/
Sprocket Framework DR2
/
Sprocket Framework Interfaces
/
SprocketMacros.h
< prev
next >
Wrap
Text File
|
1996-04-16
|
1KB
|
37 lines
// Sprocket Framework header file
// SprocketMacros.h
#if qDebug
#if GENERATINGPOWERPC
#define DebugMessage(x) DebugStr(x)
#else
#define DebugMessage(x) SysBreakStr(x)
#endif
#if GENERATINGPOWERPC
inline void DebugNum(long x) {Str255 s; NumToString(x, s); DebugStr(s);}
#else
inline void DebugNum(long x) {Str255 s; NumToString(x, s); SysBreakStr(s);}
#endif
#else
#define DebugMessage(x)
#define DebugNum(x)
#endif
inline void FailErr(OSErr theErr) { if(theErr != noErr) throw(theErr); }
inline void FailOSErr(OSErr theErr) { FailErr(theErr); }
inline void FailResError() { FailErr(ResError()); }
inline void FailMemError() { FailErr(MemError()); }
inline void FailNil(void* ptr) { if(ptr == nil) throw(nilHandleErr); }
inline void FailResErrorOrNil(void* ptr) { FailResError(); FailNil(ptr); }
inline void FailMemErrorOrNil(void* ptr) { FailMemError(); FailNil(ptr); }
inline Point TopLeft( Rect& r ) { return *(Point *) &(r).top; }
inline Point BotRight( Rect& r ) { return *(Point *) &(r).bottom; }